#include <iostream>
using namespace std;

int main (void)
{
	int a = 66;
	int& b = a; //b引用a,b就是a的别名
	cout << "&a=" << &a << ",a=" << a << endl;
	cout << "&b=" << &b << ",b=" << b << endl;
	
	b = 88;
	cout << "&a=" << &a << ",a=" << a << endl;
	cout << "&b=" << &b << ",b=" << b << endl;
	
	int c = 99;
	b = c;//将c赋给b 等价于给a赋值
	cout << "&a=" << &a << ",a=" << a << endl;
	cout << "&b=" << &b << ",b=" << b << endl;

	//int &r; //error
	//short& rc = c; //类型不一致

	return 0;
}
